Skip to content

Add secure PyPI trusted publishing workflow - #8

Merged
TonisOrmisson merged 1 commit into
mainfrom
agent/pypi-trusted-publishing
Aug 4, 2026
Merged

Add secure PyPI trusted publishing workflow#8
TonisOrmisson merged 1 commit into
mainfrom
agent/pypi-trusted-publishing

Conversation

@TonisOrmisson

Copy link
Copy Markdown
Contributor

Summary

Adds a manual, secretless PyPI release workflow for the installable specification package.

  • builds and verifies the sdist and wheel in a job without OIDC permissions
  • transfers only the built distributions to the publish job
  • grants id-token: write only to the PyPI publish job
  • uses the protected pypi GitHub environment
  • pins every third-party Action to a verified immutable commit SHA

Validation

  • actionlint v1.7.12 .github/workflows/publish.yml
  • python -m pytest -q: 6 passed, 2 subtests passed
  • python tools/validate_repository.py
  • python -m build
  • python -m twine check dist/*

PyPI pending publisher

Configure these exact values before the first workflow run:

  • PyPI project: openstatspec-specification
  • GitHub owner: OpenStatSpec
  • Repository: specification
  • Workflow: publish.yml
  • Environment: pypi

The workflow is intentionally manual so publishing remains an explicit release action.

@TonisOrmisson
TonisOrmisson merged commit 0d01c7e into main Aug 4, 2026
2 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3384323884

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +3 to +4
on:
workflow_dispatch:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restrict publishing to a protected release tag

A default dispatch checks out main and publishes its currently unreleased 0.2.1 artifact without requiring the protected v0.2.1 tag mandated by ROADMAP.md:88-92 and VERSIONING.md:31. This also permits selecting another branch: gh workflow run --help documents --ref as the “Branch or tag name which contains the version of the workflow file” (upstream manual). Consequently, an approved run from an untagged or modified ref can publish bytes that never passed the tag-based release gate; reject non-release-tag refs and validate that the tag matches the package version before granting the publish job OIDC access.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant